﻿Public Class ResultsRow

    Public _Rank As Integer
    Public Property Rank() As Integer
        Get
            Return _Rank
        End Get
        Set(ByVal value As Integer)
            _Rank = value
            RankLabel.Text = _Rank
        End Set
    End Property

    Private _Description As String
    Public Property Description() As String
        Get
            Return _Description
        End Get
        Set(ByVal value As String)
            _Description = value
            DescriptionTB.Text = _Description
        End Set
    End Property

    Private _Url As String
    Public Property Url() As String
        Get
            Return _Url
        End Get
        Set(ByVal value As String)
            _Url = value
            URLLabel.Text = _Url
        End Set
    End Property

    Private _Title As String
    Public Property Title() As String
        Get
            Return _Title
        End Get
        Set(ByVal value As String)
            _Title = value
            TitleLabel.Text = _Title
        End Set
    End Property

    Private _GTag As Boolean
    Public Property GTag() As Boolean
        Get
            Return _GTag
        End Get
        Set(ByVal value As Boolean)
            _GTag = value
            GPanel.Visible = _GTag
        End Set
    End Property

    Private _YTag As Boolean
    Public Property YTag() As Boolean
        Get
            Return _YTag
        End Get
        Set(ByVal value As Boolean)
            _YTag = value
            YPanel.Visible = _YTag
        End Set
    End Property

    Private _BTag As Boolean
    Public Property BTag() As Boolean
        Get
            Return _BTag
        End Get
        Set(ByVal value As Boolean)
            _BTag = value
            BPanel.Visible = _BTag
        End Set
    End Property

    Private _GRank As Integer
    Public Property GRank() As Integer
        Get
            Return _GRank
        End Get
        Set(ByVal value As Integer)
            _GRank = value
            GRankLabel.Text = _GRank
        End Set
    End Property

    Private _YRank As Integer
    Public Property YRank() As Integer
        Get
            Return _YRank
        End Get
        Set(ByVal value As Integer)
            _YRank = value
            YRankLabel.Text = _YRank
        End Set
    End Property

    Private _BRank As Integer
    Public Property BRank() As Integer
        Get
            Return _BRank
        End Get
        Set(ByVal value As Integer)
            _BRank = value
            BRankLabel.Text = _BRank
        End Set
    End Property
    Private _index As Integer
    Public Property Index() As Integer
        Get
            Return _index
        End Get
        Set(ByVal value As Integer)
            _index = value
        End Set
    End Property

    Private Sub ResultsRow_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize

    End Sub

    'Private Sub ResultsRow_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
    '    Me.DescriptionTB.Location = New System.Drawing.Point(74, 22)
    '    Me.DescriptionTB.Size = New System.Drawing.Size((Me.DescriptionTB.Width - Me.TagPanel.Width - 2), Me.Height)
    '    Me.TagPanel.Location = New System.Drawing.Point((Me.Width - Me.TagPanel.Width), 0)
    '    'Me.TagPanel.Size = New System.Drawing.Size((Me.Width - Me.TagPanel.Width), Me.Height)
    'End Sub

    Public Sub FillRow(ByRef Result As ResultsItem)
        Title = Result.getTitle
        Url = Result.getURL
        GTag = Result.geiIsGoogle
        BTag = Result.getIsBing
        YTag = Result.getIsYahoo
        Rank = Result.getScore
        Description = Result.desc
        GRank = Result.gscore
        BRank = Result.bscore
        YRank = Result.yscore
    End Sub

    Private Sub TitleLabel_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles TitleLabel.LinkClicked
        ResaultsNavigator.WebBrowser1.Navigate(Url)
        ResaultsNavigator.Visible = True
    End Sub
End Class
